
import { fetch } from './http.interceptor.js'

const obj = {
  headerGET: {
    "Content-type":'application/x-www-from-urlencoded'
  },
  headerPOST: {
    // "Content-type":'application/json;charset=UTF-8'
		"Content-type":'application/x-www-form-urlencoded'
  },
}

// 通用接口请求
export const reqAll = (url,params,opt={}) => {
  opt.data = params
  opt.header = obj['headerPOST']
  return fetch(url,opt)
}

// get请求
export const reqGet = (url,params,opt={}) => {
  opt.header = obj['headerGET']
  opt.method = "GET"
  opt.data = params
  return fetch(url,opt)
}

// post请求
export const reqPost = (url,params,opt={}) => {
  opt.header = obj['headerPOST']
  opt.method = "POST"
  opt.data = params
  return fetch(url,opt)
}




